package com.vanzo.some.test;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Since;
import com.google.gson.annotations.Until;

import java.util.Arrays;

/**
 * Created by tisen on 2017/10/24.
 */

public class User {

    @SerializedName("n")
    @Since(1.1)
    @Expose(serialize = true, deserialize = true)
    private String name;


    @SerializedName("a")
    @Since(1.3)
    @Expose(serialize = true, deserialize = true)
    private int age;


    @SerializedName("s")
    @Until(0.9)
    @Expose(serialize = true, deserialize = true)
    private int sex;


    @Expose(serialize = false, deserialize = false)
    private String address;

    @Expose(serialize = true, deserialize = true)
    private String[] friends;

    public User() {
    }


    public User(String name, int age, int sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public String[] getFriends() {
        return friends;
    }

    public void setFriends(String[] friends) {
        this.friends = friends;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", address='" + address + '\'' +
                ", friends=" + Arrays.toString(friends) +
                '}';
    }
}
